package com.bestillet.kyllingogco;

import android.os.Parcel;
import android.os.Parcelable;

public class Category implements Parcelable {
	private String headline, extra;
	
	private boolean header;
	private int categoriId, level;
	
	public Category(String headline, String extra, int categoryId, int level, boolean header) {
		this.headline = headline;
		this.extra = extra;
		this.categoriId = categoryId;
		this.level = level;
		this.header = header;
	}
	
	public Category() {
		
	}

	public String getHeadline() {
		return headline;
	}

	public void setHeadline(String headline) {
		this.headline = headline;
	}

	public String getExtra() {
		return extra;
	}

	public void setExtra(String extra) {
		this.extra = extra;
	}

	public int getCategoriId() {
		return categoriId;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public void setCategoriId(int categoriId) {
		this.categoriId = categoriId;
	}

	public boolean isHeader() {
		return header;
	}

	public void setHeader(boolean header) {
		this.header = header;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel out, int flags) {
		out.writeString(headline);
		out.writeString(extra);
		out.writeInt(categoriId);
		out.writeInt(level);
		out.writeByte((byte)(header ? 1 : 0));
	}
	
	public static final Parcelable.Creator<Category> CREATOR = new Parcelable.Creator<Category>() {
		@Override
		public Category createFromParcel(Parcel in) {
			return new Category(in);
		}

		@Override
		public Category[] newArray(int size) {
			return new Category[size];
		}
	};
	
	private Category(Parcel in) {
		this.headline = in.readString();
		this.extra = in.readString();
		this.categoriId = in.readInt();
		this.level = in.readInt();
		this.header = in.readByte() == 1;
	}
}